import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'landing-page',
      redirect: '/welcome'
    },
    {
      path: '*',
      redirect: '/'
    },
    {
      path: '/login',
      name: 'login',
      component: require('@/view/login/index.vue').default
    },
    {
      path: '/welcome',
      name: 'welcome',
      component:  require('@/view/home/index.vue').default,
      redirect: '/home',
      children: [
        {path: '/home', name: 'Home', component: require('@/view/home/Home.vue').default},
        {path: '/licenseApply',name: 'LicenseApply', component: require('@/view/license/LicenseApply.vue').default},
        {path: '/licenseApproval',name: 'LicenseApproval', component: require('@/view/license/LicenseApprovalList.vue').default},
        {path: '/licenseList',name: 'LicenseList', component: require('@/view/license/LicenseList.vue').default},
        {path: '/licenseUserConfig',name: 'LicenseUserConfig', component: require('@/view/license/LicenseUserConfig.vue').default},
        {path: '/config',name: 'config', component: require('@/view/config/index.vue').default},
        {path: '/licenseConfigDetail',name: 'licenseConfigDetail', component: require('@/view/config/license/detail.vue').default},
        {path: '/licenseConfigEdit',name: 'licenseConfigEdit', component: require('@/view/config/license/edit.vue').default},
        {path: '/zentao',name: 'ZenTao', component: require('@/view/zentao/index.vue').default},
        {path: '/zentaoConfigDetail',name: 'zentaoConfigDetail', component: require('@/view/config/zentao/detail.vue').default},
        {path: '/zentaoConfigEdit',name: 'zentaoConfigEdit', component: require('@/view/config/zentao/edit.vue').default},
        {path: '/tool',name: 'EnumTrans', component: require('@/view/tool/index.vue').default},
        {path: '/roleManage',name: 'RoleManage',component: require('@/view/roleManage/RoleManage.vue').default},
        {path: '/userManage',name: 'UserManage',component: require('@/view/roleManage/UserManage.vue').default},
        {path: '/userAdd',name: 'UserManage', component: require('@/view/roleManage/UserAdd.vue').default},
        {path: '/roleAdd',name: 'RoleManage', component: require('@/view/roleManage/RoleAdd.vue').default},
        {path: '/roleEdit/:id',name: 'RoleManage', component: require('@/view/roleManage/RoleEdit.vue').default},
        {path: '/userEdit/:id',name: 'UserManage', component: require('@/view/roleManage/UserEdit.vue').default},
        {path: '/personalInformation',name: 'PersonalInformation', component: require('@/view/system/PersonalInformation.vue').default},
        {path: '/systemConfiguration',name: 'SystemConfiguration', component: require('@/view/system/SystemConfiguration.vue').default},
        {path: '/serverInfo/manage', name: 'ServerInfoManage', component: require('@/view/serverInfo/ServerInfoManage.vue').default},
        {path: '/openApi/manage', name: 'OpenApiManage', component: require('@/view/openApiManage/OpenApiManage.vue').default},
        {path: '/openApi/manage/add', name: 'OpenApiManage', component: require('@/view/openApiManage/OpenApiManageAdd.vue').default},
        {path: '/openApi/manage/edit', name: 'OpenApiManage', component: require('@/view/openApiManage/OpenApiManageEdit.vue').default},
        {path: '/openApi/manage/detail', name: 'OpenApiManage', component: require('@/view/openApiManage/OpenApiManageDetail.vue').default},
        {path: '/openApi/test', name: 'OpenApiTest', component: require('@/view/openApiTest/OpenApiTest.vue').default}
      ]
    },
    {
      path: '/serverLogs',
      name: 'ServerLogs',
      component: require('@/view/serverInfo/ServerLogs.vue').default
    }
  ]
})
